<?php
/**
 * Enter description here ...
 * @author Micou13630
 *
 */
class ErrorDataAccessDao implements IDataAccessDao {
	
	private $status;
	private $message;
	
	/**
	 * Constructeur
	 */
	public function ErrorDataAccessDao($status, $message) {
		$this->status = $status;
		$this->message = $message;
	}
	
	/** Lecture de donnee
	 * @param IData $data
	 */
	public function fetch(IRequestDao $requestDao) {
		return $this->returnError();
	}
	
	/**
	 * Ajouter un item
	 * @param IData $data
	 */
	public function add(IRequestDao $requestDao) {
		return $this->returnError();
	}
	
	/**
	 * Effacer un item
	 * @param IData $data
	 */
	public function remove(IRequestDao $requestDao) {
		return $this->returnError();
	}
	
	/**
	 * Modifier un item
	 * @param IData $data
	 */
	public function update(IRequestDao $requestDao) {
		return $this->returnError();
	}
	
	private function returnError() {
		$err = new ErrorValidationDao($this->status);
		$err->addMessage('GlypheError', $this->message);
		return $err;
	}
	
	/**
	 * Renvoie le ou les champs constituant la clef primaire
	 * Enter description here ...
	 */
	public function primaryKeyFields() {
		return null;
	}
}
?>